#include "AppModel.h"
#include "CCommonSettings.h"

CAppModel* CAppModel::Instance_ = new CAppModel;
CAppModel* CAppModel::Instance()
{
	return Instance_;
}

void CAppModel::ReadConfiguration()
{
    zl::CCommonSettings settings;
    settings.ReadConfig(base_config_, "./zlbase.ini");
    settings.ReadConfig(config_, "./app.ini");

}

void CAppModel::WriteConfiguration()
{
    zl::CCommonSettings settings;
    settings.WriteConfig(base_config_, "./zlbase.ini");
    settings.WriteConfig(config_, "./app.ini");
}

int32_t CAppModel::GetLockersPaymentInfo(int32_t t)
{
    switch (t)
    {
    case zl::ELockerType_Small:
        return config_.payment.payment_small;
    case zl::ELockerType_Medium:
        return config_.payment.payment_medium;
    case zl::ELockerType_Large:
        return config_.payment.payment_large;
    case zl::ELockerType_ExtraLarge:
        return config_.payment.payment_extra_large;
    default:
        return -1;
    }
}
